package com.chen.qq;

import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;

/**
 * @author 5
 * 
 */
public class DefaultPolicy implements TransformPolicy {

	public static final int rect = 0;

	protected void translate(Shape rect, Shape shape) {
		Rectangle bounds = shape.getBounds();
		int W = (int) rect.getBounds().getWidth();
		int H = (int) rect.getBounds().getHeight();
		int w = (int) bounds.getWidth();
		int h = (int) bounds.getHeight();

		bounds.translate((W - w) / 2, (H - h) / 2);
	}

	@Override
	public boolean transform(Graphics2D g1, Graphics2D g2, float ratio, float width, float height) {
		return true;
	}

}
